#coding: utf-8


import ctypes

# import getpass
# print getpass.getuser()

# getpass.fallback_getpass("sfsff", None)


puname=ctypes.c_char_p("auto_server_val_hz") 
pdomain=ctypes.c_char_p("hq.ta-mp.com") 
lpszPassword=ctypes.c_char_p("tcl@2618") 
dwLogonType=ctypes.c_uint32() 
dwLogonProvider=ctypes.c_uint32() 
dwLogonType.value=3 
dwLogonProvider.value=0 
phToken=ctypes.pointer(ctypes.c_int32(0)) 

ret = ctypes.windll.Advapi32.LogonUserA(puname,pdomain,lpszPassword,dwLogonType,dwLogonProvider,ctypes.byref(phToken)) 

print str(ret)
